package menu

import (
	"context"
	"errors"
)

var (
	ErrMenuNotFound    = errors.New("menu not found")
	ErrMenuExist       = errors.New("menu exist")
	ErrMenuApiNotFound = errors.New("menu api not found")
	ErrMenuExistRole   = errors.New("菜单已被角色引用，不能删除")
	ErrMenuExitsChild  = errors.New("菜单存在子菜单，不能删除")
)

type Service interface {
	GetMenuList(ctx context.Context) ([]Menu, error)
	MenuTreeSelect(ctx context.Context) ([]TreeSelect, error)
	GetMenu(ctx context.Context, cmd GetMenuCommand) (Menu, error)
	Insert(ctx context.Context, cmd Menu) error
	BatchInsert(ctx context.Context, cmd []Menu) (err error)
	Update(ctx context.Context, menu Menu) error
	Remove(ctx context.Context, cmd RemoveMenuCommand) error
	GetMenuWithRole(ctx context.Context, roleIds []string) ([]*MainMenu, error)
	UpdateMenuApi(ctx context.Context, cmd UpdateMenuApiCommand) (err error)
	ExportMenu(ctx context.Context, cmd GetMenuCommand) (result []Menu, err error)
}
